import type { DeptAdd,updateDept } from '@/model'

import request from '@/utils/request'


export const  getDeptInfo = (id:number) => request.get(`/getDeptHis/${id}`)
export const  getDeptListInfo = () => request.get('/getDeptListInfo')
export const  selectDeptInfo = (id:number) => request.get(`/selectDeptInfo/${id}`)
export const  getDeptEmp = (id:number) => request.get(`/getDeptEmp/${id}`)
export const addDept = (ruleForm: DeptAdd) =>
    request.post('/addDept', JSON.stringify(ruleForm), {
      headers: {
        'Content-Type': 'application/json'
      }
    })
    export const select = (deptName: string, status: string) => 
      request.get(`/selectByNameAndStatus`, {
        params: {
          deptName: deptName,
          status: status
        }
      });
export const updateDeptInfo = (updateInfo: updateDept) => 
  request.post('/updateDept', JSON.stringify(updateInfo), {
  headers: {
    'Content-Type': 'application/json'
  }
})

export const updateStatusfn = (id: number, status: string) => 
  request.get(`/updateStatus`, {
    params: {
      id: id,
      status: status
    }
  });

  
